/**
 * @author Roderick Cusirramos Montesinos
 * @version 0.1
 */

package solucionessgh.View;

import java.awt.BorderLayout;
import java.awt.Image;
import java.awt.Toolkit;
import javax.swing.JFrame;
import javax.swing.JMenuBar;
import javax.swing.JPanel;
import javax.swing.JToolBar;





public class ViewFrame extends JFrame{

    public ViewFrame( ) {
        this.setTitle("Soluciones");
        PanelFondo fondo = new PanelFondo();
        this.add(fondo, BorderLayout.CENTER);
        this.setIconImage(getIconImage());
        this.setSize(500, 500);
        centrarVentana();
        this.pack();
        //initcomponents();
    }

    public void initcomponents(){
        
        
        PanelFondo fondo = new PanelFondo();
        this.add(fondo, BorderLayout.CENTER);
        
        
        
        this.pack();
    }

    public Image getIconImage() {
        Image retValue = Toolkit.getDefaultToolkit().
                getImage(getClass().getResource("/solucionessgh/resources/icon.png"));
        return retValue;
    }

    private void centrarVentana(){
        //centrar la ventana
        java.awt.Toolkit tk = java.awt.Toolkit.getDefaultToolkit();
        java.awt.Dimension screenSize = tk.getScreenSize();
        int screenHeight = screenSize.height;
        int screenWidth = screenSize.width;
        this.setSize(screenWidth / 2, screenHeight / 2);
        this.setLocation(screenWidth / 4, screenHeight / 4);
    }

    public void setMenu(JMenuBar menu){
        this.setJMenuBar(menu);
    }

    public void setToolbar(JToolBar toolbar ){
        this.getContentPane().add(toolbar,BorderLayout.NORTH);
    }

    public void setStatusbar(JPanel status ){
        this.getContentPane().add(status,BorderLayout.SOUTH);
    }

    public String getName() {
        return "ViewFrame";
    }
}
